package com.jiang.daily.Q1935;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/09/15 16:22
 */
class Solution {
    public int canBeTypedWords(String text, String brokenLetters) {
        int[] arr = new int[26];
        for (char c: brokenLetters.toCharArray()) {
            arr[c - 'a'] = 1;
        }

        int res = 0;
        for (String t: text.split(" ")) {
            boolean flag = true;
            for (char c: t.toCharArray()) {
                if (arr[c - 'a'] == 1) {
                    flag = false;
                    break;
                }
            }
            if (flag) res++;
        }
        return res;
    }
}
